﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Text;
using Microsoft.Practices.EnterpriseLibrary.Data;
using Microsoft.Practices.EnterpriseLibrary.Data.Sql;

namespace Dzzzr.DataLayer
{
	public class GameEntityProvider
	{
		
		public static IDataReader GetUnusedGameEntities(int gameID)
		{
			return Helper.DB.ExecuteReader("GetUnusedEntityListByGameID", gameID);
		}

		public static IDataReader GetUsedGameEntities(int gameID)
		{
			return Helper.DB.ExecuteReader("GetEntityListByGameID", gameID);
		}

		public static void AssignEntity(GameEntityInfo entity)
		{
			Helper.DB.ExecuteNonQuery("AssignEntityToGame", entity.GameID,entity.EntityID,entity.ParentID,entity.GameRoleID,entity.Visible,entity.OrderNumber);
		}

		public static void DeleteAssignment(GameEntityInfo entity)
		{
			Helper.DB.ExecuteNonQuery("DeleteAssignment", entity.GameID, entity.EntityID);
		}
	}
}
